/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.fee.entity.Bill;
import com.jeeplus.modules.fee.mapper.BillMapper;

/**
 * 收款单Service
 * @author weisong
 * @version 2017-09-22
 */
@Service
@Transactional(readOnly = true)
public class BillService extends CrudService<BillMapper, Bill> {

	public Bill get(String id) {
		return super.get(id);
	}
	
	public List<Bill> findList(Bill bill) {
		return super.findList(bill);
	}
	
	public Page<Bill> findPage(Page<Bill> page, Bill bill) {
		return super.findPage(page, bill);
	}
	
	@Transactional(readOnly = false)
	public void save(Bill bill) {
		super.save(bill);
	}
	
	@Transactional(readOnly = false)
	public void delete(Bill bill) {
		super.delete(bill);
	}

	// 更新状态
	@Transactional(readOnly = false)
	public int updateStatusById(Integer status, String id) {
		return mapper.updateStatusById(status, id);
	}

	// 查询最大的单号和日期【用来生成单号】
	public Bill findBillNoAndBillDate() {
		return mapper.findBillNoAndBillDate();
	}
}